home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / NFSD / NFSD.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  4KB  |  174 lines

  1. /*
  2.  * linux/include/linux/nfsd/nfsd.h
  3.  *
  4.  * Hodge-podge collection of knfsd-related stuff.
  5.  * I will sort this out later.
  6.  *
  7.  * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
  8.  */
  9.  
  10. #ifndef LINUX_NFSD_NFSD_H
  11. #define LINUX_NFSD_NFSD_H
  12.  
  13. #include <linux/types.h>
  14. #include <linux/unistd.h>
  15. #include <linux/dirent.h>
  16. #include <linux/fs.h>
  17.  
  18. #include <linux/nfsd/debug.h>
  19. #include <linux/nfsd/nfsfh.h>
  20. #include <linux/nfsd/export.h>
  21. #include <linux/nfsd/auth.h>
  22. #include <linux/nfsd/stats.h>
  23.  
  24. /*
  25.  * nfsd version
  26.  */
  27. #define NFSD_VERSION        "0.4"
  28.  
  29. #ifdef __KERNEL__
  30. /*
  31.  * Special flags for nfsd_permission. These must be different from MAY_READ,
  32.  * MAY_WRITE, and MAY_EXEC.
  33.  */
  34. #define MAY_NOP            0
  35. #define MAY_SATTR        8
  36. #define MAY_TRUNC        16
  37. #if (MAY_SATTR | MAY_TRUNC) & (MAY_READ | MAY_WRITE | MAY_EXEC)
  38. # error "please use a different value for MAY_SATTR or MAY_TRUNC."
  39. #endif
  40. #define MAY_CREATE        (MAY_EXEC|MAY_WRITE)
  41. #define MAY_REMOVE        (MAY_EXEC|MAY_WRITE|MAY_TRUNC)
  42.  
  43. /*
  44.  * Callback function for readdir
  45.  */
  46. struct readdir_cd {
  47.     struct svc_rqst *    rqstp;
  48.     struct svc_fh *        dirfh;
  49.     u32 *            buffer;
  50.     int            buflen;
  51.     u32 *            offset;        /* previous dirent->d_next */
  52.     char            plus;        /* readdirplus */
  53.     char            eob;        /* end of buffer */
  54.     char            dotonly;
  55. };
  56. typedef int        (*encode_dent_fn)(struct readdir_cd *, const char *,
  57.                         int, off_t, ino_t);
  58. typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);
  59.  
  60. /*
  61.  * Procedure table for NFSv2
  62.  */
  63. extern struct svc_procedure    nfsd_procedures2[];
  64. extern struct svc_program    nfsd_program;
  65.  
  66. /*
  67.  * Function prototypes.
  68.  */
  69. int        nfsd_svc(unsigned short port, int nrservs);
  70.  
  71. /* nfsd/vfs.c */
  72. int        fh_lock_parent(struct svc_fh *, struct dentry *);
  73. void        nfsd_racache_init(void);
  74. void        nfsd_racache_shutdown(void);
  75. int        nfsd_lookup(struct svc_rqst *, struct svc_fh *,
  76.                 const char *, int, struct svc_fh *);
  77. int        nfsd_setattr(struct svc_rqst *, struct svc_fh *,
  78.                 struct iattr *);
  79. int        nfsd_create(struct svc_rqst *, struct svc_fh *,
  80.                 char *name, int len, struct iattr *attrs,
  81.                 int type, dev_t rdev, struct svc_fh *res);
  82. int        nfsd_open(struct svc_rqst *, struct svc_fh *, int,
  83.                 int, struct file *);
  84. void        nfsd_close(struct file *);
  85. int        nfsd_read(struct svc_rqst *, struct svc_fh *,
  86.                 loff_t, char *, unsigned long *);
  87. int        nfsd_write(struct svc_rqst *, struct svc_fh *,
  88.                 loff_t, char *, unsigned long, int);
  89. int        nfsd_readlink(struct svc_rqst *, struct svc_fh *,
  90.                 char *, int *);
  91. int        nfsd_symlink(struct svc_rqst *, struct svc_fh *,
  92.                 char *name, int len, char *path, int plen,
  93.                 struct svc_fh *res);
  94. int        nfsd_link(struct svc_rqst *, struct svc_fh *,
  95.                 char *, int, struct svc_fh *);
  96. int        nfsd_rename(struct svc_rqst *,
  97.                 struct svc_fh *, char *, int,
  98.                 struct svc_fh *, char *, int);
  99. int        nfsd_remove(struct svc_rqst *,
  100.                 struct svc_fh *, char *, int);
  101. int        nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type,
  102.                 char *name, int len);
  103. int        nfsd_truncate(struct svc_rqst *, struct svc_fh *,
  104.                 unsigned long size);
  105. int        nfsd_readdir(struct svc_rqst *, struct svc_fh *,
  106.                 loff_t, encode_dent_fn,
  107.                 u32 *buffer, int *countp);
  108. int        nfsd_statfs(struct svc_rqst *, struct svc_fh *,
  109.                 struct statfs *);
  110. int        nfsd_notify_change(struct inode *, struct iattr *);
  111. int        nfsd_permission(struct svc_export *, struct dentry *, int);
  112.  
  113. /* nfsd/nfsctl.c */
  114. void        nfsd_modcount(struct inode *, int);
  115.  
  116. /*
  117.  * lockd binding
  118.  */
  119. void        nfsd_lockd_init(void);
  120. void        nfsd_lockd_shutdown(void);
  121. void        nfsd_lockd_unexport(struct svc_client *);
  122.  
  123.  
  124. #ifndef makedev
  125. #define makedev(maj, min)    (((maj) << 8) | (min))
  126. #endif
  127.  
  128. /*
  129.  * These variables contain pre-xdr'ed values for faster operation.
  130.  * FIXME: should be replaced by macros for big-endian machines.
  131.  */
  132. extern u32    nfs_ok,
  133.         nfserr_perm,
  134.         nfserr_noent,
  135.         nfserr_io,
  136.         nfserr_nxio,
  137.         nfserr_acces,
  138.         nfserr_exist,
  139.         nfserr_xdev,
  140.         nfserr_nodev,
  141.         nfserr_notdir,
  142.         nfserr_isdir,
  143.         nfserr_inval,
  144.         nfserr_fbig,
  145.         nfserr_nospc,
  146.         nfserr_rofs,
  147.         nfserr_mlink,
  148.         nfserr_nametoolong,
  149.         nfserr_dquot,
  150.         nfserr_stale,
  151.         nfserr_remote,
  152.         nfserr_badhandle,
  153.         nfserr_notsync,
  154.         nfserr_badcookie,
  155.         nfserr_notsupp,
  156.         nfserr_toosmall,
  157.         nfserr_serverfault,
  158.         nfserr_badtype,
  159.         nfserr_jukebox;
  160.  
  161. /*
  162.  * Time of server startup
  163.  */
  164. extern struct timeval    nfssvc_boot;
  165.  
  166. /*
  167.  * The number of nfsd threads.
  168.  */
  169. extern int        nfsd_nservers;
  170.  
  171. #endif /* __KERNEL__ */
  172.  
  173. #endif /* LINUX_NFSD_NFSD_H */
  174.